<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑规则</title>
    <link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css">
    <link href="./webuploader-0.1.5/webuploader.css" rel="stylesheet" >
    <link rel="stylesheet" type="text/css" href="./jqueryconfirm/jquery-confirm.min.css">
    <link rel="stylesheet" type="text/css" href="./json-viewer/jquery.json-viewer.css">
</head>
<body style="padding: 20px;">

    <form class="form-horizontal" role="form">
        <div class="form-group">
            <label for="rule_name" class="col-sm-2 control-label">规则集名称：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="rule_name" placeholder="请输入规则集名称">
            </div>
        </div>
        <div class="form-group">
            <label for="rule_desc" class="col-sm-2 control-label">规则集描述：</label>
            <div class="col-sm-10">
                <textarea class="form-control" id="rule_desc" placeholder="请输入规则集描述"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="rule_priority" class="col-sm-2 control-label">规则集权重：</label>
            <div class="col-sm-10" style="width: 200px;">
                <select class="form-control" id="rule_priority">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="rule_type" class="col-sm-2 control-label">规则集类型：</label>
            <div class="col-sm-10"  style="width: 200px;">
                <select class="form-control" id="rule_type">
                    <option selected="selected" value="ActivationRuleGroup">复合规则类型</option>
                    <option value="UnitRuleGroup">单规则组</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="rule_name" class="col-sm-2 control-label">规则脚本：</label>





            <div class="col-sm-10">
                <ul class="nav nav-tabs" id="rule_ul">
                    <li class="active"><a href="javascript:void(0);" onclick="rule_tab(0)">规则列表</a></li>
                    <li><a href="javascript:void(0);" onclick="rule_tab(1)">添加规则</a></li>
                </ul>

                <div id="rule_ul_cen_0" style="padding: 20px;border: 1px solid #ddd;">
                    <table class="table">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>规则名称</th>
                            <th>规则描述</th>
                            <th>规则权重</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="rule_ul_cen_0_content">

                        </tbody>
                    </table>
                    <!--分页-->
                    <div  style="text-align: center;">
                        <ul id="findrulelistbyrule_pages_id"  style="margin: 0;"></ul>
                    </div>
                </div>
                <div id="rule_ul_cen_1" style="display: none;padding: 20px;border: 1px solid #ddd;">



                    <div class="form-group">
                        <label for="model_frame_editrule_name">规则名称</label>
                        <input type="text" class="form-control" id="model_frame_editrule_name" placeholder="请输入规则名称">
                    </div>
                    <div class="form-group">
                        <label for="model_frame_editrule_desc">规则描述</label>
                        <input type="text" class="form-control" id="model_frame_editrule_desc" placeholder="请输入规则描述">
                    </div>
                    <div class="form-group">
                        <label for="model_frame_editrule_priority">规则权重：</label>
                        <select class="form-control" id="model_frame_editrule_priority" style="width: 200px;">
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                            <option value="6">6</option>
                            <option value="7">7</option>
                            <option value="8">8</option>
                            <option value="9">9</option>
                            <option value="10">10</option>
                        </select>
                    </div>
                    <div class="form-group" >
                        <label>执行条件</label>
                        <div style="width: 100%;float: left;">
                            <div style="width: 47%; float: left;">
                                <table class="table table-bordered">
                                    <caption>属性列表（条件）</caption>
                                    <thead>
                                    <tr>
                                        <th>名称</th>
                                        <th>类型</th>
                                        <th>条件</th>
                                        <th>值</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="editrule_tiaojian">

                                    </tbody>
                                </table>



                            </div>
                            <div style="width: 47%; float: left;margin-left: 4%;">


                                <div class="form-group">
                                    <label>脚本内容</label>
                                    <button type="button" class="btn btn-primary" onclick="rule_and()">并且</button>
                                    <button type="button" class="btn btn-primary" onclick="rule_or()">或者</button>
                                    <button type="button" class="btn btn-danger" onclick="rule_clear();">清空</button>

                                    <textarea id="editrule_content" class="form-control" style="height: 400px;margin-top: 10px;"></textarea>
                                </div>


                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="">执行动作（输出结果）</label>
                        <div style="width: 100%;float: left;">
                            <div style="width: 100%; float: left;">
                                <table class="table table-bordered">
                                    <caption>属性列表（结果）</caption>
                                    <thead>
                                    <tr>
                                        <th>名称</th>
                                        <th>类型</th>
                                        <th>描述</th>
                                        <th>输出</th>
                                    </tr>
                                    </thead>
                                    <tbody id="editrule_jieguo">


                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>

                    <div style="width: 100%;text-align: center;">
                        <button type="button" class="btn btn-success" id="insert_guize" onclick="save_rule()" style="color: white;background-color: #449d44;border-color: #398439;">保存规则</button>
                        <button type="button" class="btn btn-success" id="update_guize" style="display:none;color: white;background-color: #449d44;border-color: #398439;">修改规则</button>

                    </div>
                </div>
            </div>
        </div>









        <div class="form-group" style="text-align: center;">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-success" id="scgzj_cont_id" onclick="save_editure()" style="color: white;background-color: #449d44;border-color: #398439;">内容提交，生成规则集</button>
                <button type="button" class="btn btn-success" id="update_scgzj_cont_id"  style="display: none; color: white;background-color: #449d44;border-color: #398439;">内容提交，修改规则集</button>
                <button type="button" class="btn btn-danger" onclick="javascript:window.close();"   style="color: white;background-color: #c9302c;border-color: #ac2925;">关闭页面</button>
            </div>
        </div>
    </form>


    <script type="text/javascript" src="./js/request.js"></script>
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript" src="./bootstrap/js/bootstrap-paginator.js"></script>
    <script type="text/javascript" src="./jqueryconfirm/jquery-confirm.min.js"></script>

    <script type="text/javascript" src="./webuploader-0.1.5/webuploader.js"></script>
    <!-- 配置文件 -->
    <script type="text/javascript" src="./ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="./ueditor/ueditor.all.js"></script>

    <script type="text/javascript" src="./json-viewer/jquery.json-viewer.js"></script>

    <script type="text/javascript">
        var docedit = "./js/editrule.js?"+Math.random();
        document.write("<script type=\"text/javascript\" src=\""+docedit+"\"><\/script>");
    </script>







    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel"></h4>
                </div>
                <div class="modal-body">
                    <table class="table">
                        <tbody>
                        <tr>
                            <td>执行条件</td>
                            <td id="zhixingtiaojian"></td>
                        </tr>
                        <tr>
                            <td>执行动做（输出结果）</td>
                            <td id="zhixingdongzuo"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->




</body>
</html>